home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / Educ / Health-Food / Recipe 1.1 Demo.sit / Recipe Master Demo / Recipe Master Demo / card_3878.txt < prev    next >
Encoding:
Text File  |  1994-08-09  |  10.2 KB  |  454 lines

  1. -- card: 3878 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3803
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on idle
  8.   put the number of buttons into x
  9.   repeat with n = 1 to x
  10.     show button n
  11.   end repeat
  12. end idle
  13.  
  14. on preview2 tempList,mealList,dataLines
  15.   repeat with n = 1 to 5
  16.     get line n of tempList
  17.     put formatNum(it) into line n of cd field id 2
  18.     get line (n + 22) of tempList
  19.     put formatNum(it) into line (n+5) of cd field id 2
  20.   end repeat
  21.   get line 45 of tempList
  22.   put formatNum(it) & return into line 10 of cd field id 2
  23.   put mealList into cd field id 5
  24.   put tempList into cd field id 8
  25.   put dataLines & return into cd field 11
  26.   repeat with n = 6 to 14
  27.     get line n of tempList
  28.     put formatNum(it) & return after cd field id 4
  29.   end repeat
  30.   repeat with n = 15 to 22
  31.     get line n of tempList
  32.     put formatNum(it) & return after cd field id 2
  33.   end repeat
  34. end preview2
  35.  
  36.  
  37.  
  38. -- part 1 (field)
  39. -- low flags: 01
  40. -- high flags: 2002
  41. -- rect: left=21 top=90 right=333 bottom=126
  42. -- title width / last selected line: 0
  43. -- icon id / first selected line: 0 / 0
  44. -- text alignment: 65535
  45. -- font id: 3
  46. -- text size: 10
  47. -- style flags: 256
  48. -- line height: 13
  49. -- part name: 
  50.  
  51.  
  52. -- part 2 (field)
  53. -- low flags: 01
  54. -- high flags: 2002
  55. -- rect: left=125 top=90 right=333 bottom=195
  56. -- title width / last selected line: 0
  57. -- icon id / first selected line: 0 / 0
  58. -- text alignment: 65535
  59. -- font id: 3
  60. -- text size: 10
  61. -- style flags: 256
  62. -- line height: 13
  63. -- part name: 
  64.  
  65.  
  66. -- part 3 (field)
  67. -- low flags: 01
  68. -- high flags: 2002
  69. -- rect: left=269 top=132 right=260 bottom=392
  70. -- title width / last selected line: 0
  71. -- icon id / first selected line: 0 / 0
  72. -- text alignment: 65535
  73. -- font id: 3
  74. -- text size: 10
  75. -- style flags: 256
  76. -- line height: 13
  77. -- part name: 
  78.  
  79.  
  80. -- part 4 (field)
  81. -- low flags: 01
  82. -- high flags: 2002
  83. -- rect: left=391 top=132 right=260 bottom=463
  84. -- title width / last selected line: 0
  85. -- icon id / first selected line: 0 / 0
  86. -- text alignment: 65535
  87. -- font id: 3
  88. -- text size: 10
  89. -- style flags: 256
  90. -- line height: 13
  91. -- part name: 
  92.  
  93.  
  94. -- part 5 (field)
  95. -- low flags: 01
  96. -- high flags: 2002
  97. -- rect: left=109 top=42 right=64 bottom=500
  98. -- title width / last selected line: 0
  99. -- icon id / first selected line: 0 / 0
  100. -- text alignment: 0
  101. -- font id: 3
  102. -- text size: 10
  103. -- style flags: 0
  104. -- line height: 13
  105. -- part name: 
  106.  
  107.  
  108. -- part 6 (button)
  109. -- low flags: 00
  110. -- high flags: A004
  111. -- rect: left=397 top=274 right=300 bottom=498
  112. -- title width / last selected line: 0
  113. -- icon id / first selected line: 0 / 0
  114. -- text alignment: 1
  115. -- font id: 0
  116. -- text size: 12
  117. -- style flags: 0
  118. -- line height: 16
  119. -- part name: Select Food
  120. ----- HyperTalk script -----
  121. on mouseUp
  122.   global valueHolder,mealList,sizeList,dataLines
  123.   put cd field 1 of card id 9116 into container
  124.   put "  Select a category:" into prompt
  125.   ShowDialog 7,5004,prompt,chicago,12,container,1,"one"
  126.   if line 1 of the result is 2 then exit mouseUp
  127.   put line 2 of the result into lineNum
  128.   put line lineNum of container into cardName
  129.   put empty into cd field id 2
  130.   put empty into cd field id 4
  131.   visual effect iris open
  132.   orderfood cardName
  133.   preview2 valueHolder,mealList,dataLines
  134.   put empty into valueHolder
  135.   put empty into mealList
  136.   put empty into dataLines
  137.   put sizeList*100 into cd field id 20
  138.   put empty into sizeList
  139. end mouseUp
  140.  
  141.  
  142.  
  143.  
  144.  
  145. -- part 7 (button)
  146. -- low flags: 00
  147. -- high flags: A004
  148. -- rect: left=399 top=307 right=330 bottom=497
  149. -- title width / last selected line: 0
  150. -- icon id / first selected line: 0 / 0
  151. -- text alignment: 1
  152. -- font id: 0
  153. -- text size: 12
  154. -- style flags: 0
  155. -- line height: 16
  156. -- part name: Exit
  157. ----- HyperTalk script -----
  158. on mouseUp
  159.   put empty into cd field id 2
  160.   put empty into cd field id 4
  161.   put empty into cd field id 5
  162.   put empty into cd field id 8
  163.   put empty into cd field id 20
  164.   put empty into cd field 11
  165.   visual effect iris close slowly
  166.   pop card
  167. end mouseUp
  168.  
  169.  
  170.  
  171. -- part 8 (field)
  172. -- low flags: 81
  173. -- high flags: 2002
  174. -- rect: left=269 top=87 right=111 bottom=494
  175. -- title width / last selected line: 0
  176. -- icon id / first selected line: 0 / 0
  177. -- text alignment: 0
  178. -- font id: 3
  179. -- text size: 10
  180. -- style flags: 0
  181. -- line height: 13
  182. -- part name: 
  183.  
  184.  
  185. -- part 9 (button)
  186. -- low flags: 00
  187. -- high flags: A004
  188. -- rect: left=283 top=274 right=299 bottom=389
  189. -- title width / last selected line: 0
  190. -- icon id / first selected line: 0 / 0
  191. -- text alignment: 1
  192. -- font id: 0
  193. -- text size: 12
  194. -- style flags: 0
  195. -- line height: 16
  196. -- part name: Calorie Profile
  197. ----- HyperTalk script -----
  198. on mouseUp
  199.   if cd field id 2 is empty then
  200.     play boing
  201.     set the hilite of button id 6 to true
  202.     answer "Select a food to analyze."
  203.     set the hilite of button id 6 to false
  204.     exit mouseUp
  205.   end if
  206.   put cd field 5 into name
  207.   put cd field 6 into portion
  208.   put 4*(line 1 of cd field id 2) into prot
  209.   put 9*(line 2 of cd field id 2) into fat
  210.   put 4*(line 3 of cd field id 2) into carb
  211.   put 7*(line 10 of cd field id 2) into alc
  212.   put 9*(line 7 of cd field id 2) into sat
  213.   put prot + fat + carb + alc into totalcal
  214.   put prot/totalcal into prot
  215.   put fat/totalcal into fat
  216.   put carb/totalcal into carb
  217.   put alc/totalcal into alc
  218.   put sat/totalcal into sat
  219.   push card
  220.   visual effect iris open slowly
  221.   go cd id 20330
  222.   set the textsize of field "Name" to 10
  223.   set the textsize of field "Date" to 10
  224.   put name into field "Name"
  225.   put "Portion:" & return & portion into field "Date"
  226.   plotpie prot,carb,fat,alc,sat
  227. end mouseUp
  228.  
  229.  
  230.  
  231. -- part 10 (button)
  232. -- low flags: 00
  233. -- high flags: A004
  234. -- rect: left=284 top=307 right=330 bottom=388
  235. -- title width / last selected line: 0
  236. -- icon id / first selected line: 0 / 0
  237. -- text alignment: 1
  238. -- font id: 0
  239. -- text size: 12
  240. -- style flags: 0
  241. -- line height: 16
  242. -- part name: Fat Profile
  243. ----- HyperTalk script -----
  244. on mouseUp
  245.   if cd field id 2 is empty then
  246.     set the hilite of button id 6 to true
  247.     play boing
  248.     answer "Select a food to analyze."
  249.     set the hilite of button id 6 to false
  250.     exit mouseUp
  251.   end if
  252.   put cd field 5 into name
  253.   put cd field 6 into portion
  254.   put line 7 of cd field id 2 into sat
  255.   put line 8 of cd field id 2 into mono
  256.   put line 9 of cd field id 2 into poly
  257.   put sat + mono + poly into total
  258.   if total = 0 then
  259.     play "boing"
  260.     answer "Sorry, fat composition data not available here."
  261.     exit mouseUp
  262.   end if
  263.   push card
  264.   visual effect iris open slowly
  265.   go cd id 22407
  266.   set the textsize of field "Name" to 10
  267.   set the textsize of field "Date" to 10
  268.   put name into field "Name"
  269.   put "Portion:" & return & portion into field "Date"
  270.   plotFats sat,mono,poly,total
  271. end mouseUp
  272.  
  273.  
  274.  
  275. -- part 11 (button)
  276. -- low flags: 00
  277. -- high flags: A004
  278. -- rect: left=340 top=10 right=32 bottom=420
  279. -- title width / last selected line: 0
  280. -- icon id / first selected line: 0 / 0
  281. -- text alignment: 1
  282. -- font id: 0
  283. -- text size: 12
  284. -- style flags: 0
  285. -- line height: 16
  286. -- part name: Print Data
  287. ----- HyperTalk script -----
  288. on mouseUp
  289.   doPrint --Handler is in stack script
  290. end mouseUp
  291.  
  292.  
  293.  
  294. -- part 14 (field)
  295. -- low flags: 01
  296. -- high flags: 2002
  297. -- rect: left=21 top=71 right=91 bottom=195
  298. -- title width / last selected line: 0
  299. -- icon id / first selected line: 0 / 0
  300. -- text alignment: 1
  301. -- font id: 3
  302. -- text size: 10
  303. -- style flags: 256
  304. -- line height: 13
  305. -- part name: 
  306.  
  307.  
  308. -- part 16 (field)
  309. -- low flags: 01
  310. -- high flags: 2002
  311. -- rect: left=269 top=113 right=133 bottom=463
  312. -- title width / last selected line: 0
  313. -- icon id / first selected line: 0 / 0
  314. -- text alignment: 1
  315. -- font id: 3
  316. -- text size: 10
  317. -- style flags: 256
  318. -- line height: 13
  319. -- part name: 
  320.  
  321.  
  322. -- part 19 (field)
  323. -- low flags: 01
  324. -- high flags: 2002
  325. -- rect: left=22 top=42 right=64 bottom=110
  326. -- title width / last selected line: 0
  327. -- icon id / first selected line: 0 / 0
  328. -- text alignment: 1
  329. -- font id: 3
  330. -- text size: 10
  331. -- style flags: 256
  332. -- line height: 13
  333. -- part name: 
  334.  
  335.  
  336. -- part 20 (field)
  337. -- low flags: 81
  338. -- high flags: 2002
  339. -- rect: left=269 top=67 right=88 bottom=369
  340. -- title width / last selected line: 0
  341. -- icon id / first selected line: 0 / 0
  342. -- text alignment: 1
  343. -- font id: 3
  344. -- text size: 10
  345. -- style flags: 256
  346. -- line height: 13
  347. -- part name: 
  348.  
  349.  
  350. -- part 21 (button)
  351. -- low flags: 00
  352. -- high flags: A004
  353. -- rect: left=311 top=74 right=103 bottom=428
  354. -- title width / last selected line: 0
  355. -- icon id / first selected line: 0 / 0
  356. -- text alignment: 1
  357. -- font id: 0
  358. -- text size: 12
  359. -- style flags: 0
  360. -- line height: 16
  361. -- part name: Add to Recipe
  362. ----- HyperTalk script -----
  363. on mouseUp
  364.   Answer "Really add to your recipe now?" with "OK" or "Cancel"
  365.   if it is "Cancel" then exit mouseUp
  366.   get cd field id 8
  367.   if it is empty then exit mouseUp
  368.   set the cursor to 4
  369.   put it into tempData -- data list in hidden field
  370.   put cd field id 5 into theName --amount and item name for ingr list
  371.   put cd field id 20 into theWt -- weight total in grams
  372.   put line 1 of cd field 11 into dataLIne
  373.   set the lockscreen to true
  374.   go to card id 14317
  375.   put theName after cd field id 2
  376.   put field 2 into temp
  377.   put addfields(tempData,temp) into field 2
  378.   put dataLine & return after field 7
  379.   put theWt & return after field 6
  380.   put field 3 + theWt into field 3
  381.   get field 3
  382.   set the numberFormat to "0.#"
  383.   put 0+it into cd field 7
  384.   put it/28.35 into cd field 8
  385.   go to card id 3878
  386.   set the lockscreen to false
  387.   answer "Item added to your recipe."
  388. end mouseUp
  389.  
  390.  
  391.  
  392. -- part 22 (field)
  393. -- low flags: 81
  394. -- high flags: 0007
  395. -- rect: left=156 top=120 right=205 bottom=356
  396. -- title width / last selected line: 0
  397. -- icon id / first selected line: 0 / 0
  398. -- text alignment: 0
  399. -- font id: 3
  400. -- text size: 12
  401. -- style flags: 0
  402. -- line height: 16
  403. -- part name: dataLine
  404.  
  405.  
  406. -- part contents for card part 1
  407. ----- text -----
  408. Protein (g)
  409.  Total Fat (g)
  410. Carb (g)
  411. Calories
  412. Fiber (g)
  413. Cholest (mg)
  414. Sat. Fat (g)
  415. Mono Fat (g)
  416. Poly Fat (g)
  417. Alcohol (g)
  418.  Vit A (IU)
  419. Vit C (mg)
  420. Thiamin (mg)
  421. Riboflvn (mg)
  422. Niacin (mg)
  423. Vit B6 (mg)
  424. Folacin (¬µg)
  425. Vit B12 (¬µg)
  426.  
  427. -- part contents for card part 3
  428. ----- text -----
  429. Calcium (mg)
  430. Iron (mg)
  431. Magnesium (mg)
  432. Phosphorus (mg)
  433. Potassium (mg)
  434. Sodium (mg)
  435. Zinc (mg)
  436. Copper (mg)
  437. Manganese (mg)
  438.  
  439.  
  440. -- part contents for background part 1
  441. ----- text -----
  442. Nutrient Profile
  443.  
  444. -- part contents for card part 19
  445. ----- text -----
  446. Food Name:
  447.  
  448. -- part contents for card part 14
  449. ----- text -----
  450. Amount per Portion
  451.  
  452. -- part contents for card part 16
  453. ----- text -----
  454. Amount per portion